<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        :root {/*:root相当于html标签选择器*/
            --width: 500px;
            --family: "华文楷体","Heiti SC",tahoma,arial,"Hiragino Sans GB","\5B8B\4F53",sans-serif;
            --padding: 30px auto 0;
            --size:30px;
        }

        .auto-center {
            width: var(--width, 100px);
            height: var(--wwwww, 500px);
            font-family: var(--family, "Microsoft YaHei", sans-serif);
            margin: 30px auto 0;
            border: 1px solid red;
            padding: var(--padding, 15px 10px 7px);
            font-size: var(--size);
        }
    </style>
</head>
<body>
    <div class="auto-center">你好你好你好</div>
</body>
</html>